package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Role;
import cn.wolfcode.crm.query.ObjectQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    void insert(Role role);

    void deleteByPrimaryKey(Long id);

    void updateByPrimaryKey(Role role);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();


    int queryForCount(ObjectQuery qo);
    List<Role> queryForList(ObjectQuery qo);

    void saveRolePermissionRalation(@Param("roleIds") Long id, @Param("permissinId") Long permissinId);

    void deleteRolePermissionRalationByRoleId(@Param("roleIds") Long id);

    void deleteRolesystemMenuRalationByRoleId(Long menuId);

    void saveRolesystemMenuRalation(@Param("roleIds") Long id, @Param("menuId") Long systemMenuId);

    void insertPermissionRoleRelation(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    void deletePermissionRoleRelation(Long roleId);

    List<Long> queryRoleIdsByEmpId(Long empId);

    List<String> queryRoleSnByEmpId(Long id);
}
